﻿namespace RestaurantMenu.Library
{
    public abstract class Drink : Product
    {
        // fields
        private int prepareTime;
        private decimal alcByVolume;

        // constructor
        protected Drink()
        {
        }

        protected Drink(string drinkName, decimal price, int weight)
            : base(drinkName, price, weight)
        {
        }

        // properties
        public int PrepareTime
        {
            get
            {
                return this.prepareTime;
            }

            protected set
            {
                this.prepareTime = value;
            }
        }

        public decimal AlcByVolume
        {
            get
            {
                return this.alcByVolume;
            }

            protected set
            {
                if (value > 10 || value < 0)
                {
                    throw new InvalidRangeException<int>(string.Format("The Alcohol By Volume is not in range [{0}..{1}]!", 0, 1), 0, 100);
                }

                this.alcByVolume = value;
            }
        }
    }
}